@extends('layouts.layouts')
@section('title')
    <title>后台首页</title>
@endsection
@section('content')
    <link rel="stylesheet" href="/lib/layer/theme/default/layer.css"/>
    <script type="text/javascript" src="/lib/layer/layer.js"></script>
    <div class="content">
        <div class="header">
            <ul class="breadcrumb">
                <li><a href="/wechat/list">课程素材管理</a></li>
                <li class="active">课程列表</li>
            </ul>
        </div>
        <div class="main-content">
            <div class="btn-toolbar list-toolbar">
                <form class="form-inline" action="" method="get">
                    <!-- <a href="/course/create"><button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exampleModal" ><i class="fa fa-plus"></i> 新增</button></a> -->
                    <div class="form-group">
                        <input type="text" class="form-control" name="title" placeholder="课程标题" value="{{$title}}">
                    </div>
                    <button type="submit" class="btn btn-default">筛选</button>
                </form>
            </div>
            <div class="row">
                <div class="col-sm-12 col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-heading no-collapse">课程列表</div>
                        <table class="table table-bordered table-striped">
                            <thead>
                            <tr>
                                <th>编号</th>
                                <th>课程名称</th>
                                <th>课程邀请卡图片</th>
                                <th>活动邀请卡图片</th>
                                <!-- <th>是否付费</th> -->
                                <th>导师</th>
                                <th>微信关键字</th>
                                <th>编辑时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($courseClass as $class)
                                <tr id="courseClass_{{$class->id}}">
                                    <td>{{$class->id}}</td>
                                    <td>{{$class->title}}</td>
                                    <td>
                                    @if(get_course_class_img($class->id))
                                    <img class="pimg" height="80" src="{{env('WEB_URL')}}{{get_course_class_img($class->id)}}" />
                                    @else
                                    暂无图片
                                    @endif
                                    </td>
                                    <td>
                                    @if(get_course_class_img($class->id,'activity_two_url'))
                                    <img class="pimg" height="80" src="{{env('WEB_URL')}}{{get_course_class_img($class->id, 'activity_two_url')}}" />
                                    @else
                                    暂无图片
                                    @endif
                                    </td>
                                    <!-- <td>{{$class->is_free==0?'免费':'付费'}}</td> -->
                                    @if($class->author)
                                    <td>{{$class->author->name}}</td>
                                    @else
                                    <td></td>
                                    @endif
                                    <td>{{get_course_class_img($class->id, 'wx_keyword')}}</td>
                                    <td>{{$class->updated_at}}</td>
                                    <td class="text-justify" style="width:189px;">
                                        <a class="btn btn-success btn-xs" href="/wechat/addimg?id={{$class->id}}">
                                        上传素材
                                        </a>
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            {{$courseClass->appends(['title'=>$title])->render()}}
        </div>
    </div>
    <script type="text/javascript">
        
    </script>
@endsection